Trò chơi đua xe động vật trong UNITY Engine
114.937 lượt xem;
- ICustomTiledImporter.cs
- Editor /
- Scripts /
- Tiled2Unity /
- Assets /
- project /
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5
6 using UnityEngine;
7
8 namespace Tiled2Unity
9 {
10 interface ICustomTiledImporter
11 {
12 // A game object within the prefab has some custom properites assigned through Tiled that are not consumed by Tiled2Unity
13 // This callback gives customized importers a chance to react to such properites.
14 void HandleCustomProperties(GameObject gameObject, IDictionary<string, string> customProperties);
15
16 // Called just before the prefab is saved to the asset database
17 // A last chance opporunity to modify it through script
18 void CustomizePrefab(GameObject prefab);
19 }
20 }
21
22 // Examples
23 /*
24 [Tiled2Unity.CustomTiledImporter]
25 class CustomImporterAddComponent : Tiled2Unity.ICustomTiledImporter
26 {
27 public void HandleCustomProperties(UnityEngine.GameObject gameObject,
28 IDictionary<string, string> props)
29 {
30 // Simply add a component to our GameObject
31 if (props.ContainsKey("AddComp"))
32 {
33 gameObject.AddComponent(props["AddComp"]);
34 }
35 }
36
37
38 public void CustomizePrefab(GameObject prefab)
39 {
40 // Do nothing
41 }
42 }
43 */
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5
6 using UnityEngine;
7
8 namespace Tiled2Unity
9 {
10 interface ICustomTiledImporter
11 {
12 // A game object within the prefab has some custom properites assigned through Tiled that are not consumed by Tiled2Unity
13 // This callback gives customized importers a chance to react to such properites.
14 void HandleCustomProperties(GameObject gameObject, IDictionary<string, string> customProperties);
15
16 // Called just before the prefab is saved to the asset database
17 // A last chance opporunity to modify it through script
18 void CustomizePrefab(GameObject prefab);
19 }
20 }
21
22 // Examples
23 /*
24 [Tiled2Unity.CustomTiledImporter]
25 class CustomImporterAddComponent : Tiled2Unity.ICustomTiledImporter
26 {
27 public void HandleCustomProperties(UnityEngine.GameObject gameObject,
28 IDictionary<string, string> props)
29 {
30 // Simply add a component to our GameObject
31 if (props.ContainsKey("AddComp"))
32 {
33 gameObject.AddComponent(props["AddComp"]);
34 }
35 }
36
37
38 public void CustomizePrefab(GameObject prefab)
39 {
40 // Do nothing
41 }
42 }
43 */
A game object within the prefab has some custom properites assigned through Tiled that are not consumed by Tiled2Unity
This callback gives customized importers a chance to react to such properites.
Called just before the prefab is saved to the asset database
A last chance opporunity to modify it through script
Examples
Simply add a component to our GameObject
Do nothing